package com.example.mq.mqserver.mapper;

import com.example.mq.mqserver.core.Binding;
import com.example.mq.mqserver.core.Exchange;
import com.example.mq.mqserver.core.MSGQueue;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MetaMapper {
    //提供三个核心建表方法
    void createExchangeTable();

    void createQueueTable();

    void createBindingTable();

    //针对上述三个基本概念进行插入和删除
    void insertExchange(Exchange exchange);

    void deleteExchange(String exchangeName);

    List<Exchange> selectAllExchanges();

    void insertQueue(MSGQueue queue);

    void deleteQueue(String queueName);

    List<MSGQueue> selectAllQueues();

    //绑定没有主键，删除操作其实是针对exchangeName和queueName两个进行操作
    void insertBinding(Binding binding);

    void deleteBinding(Binding binding);

    List<Binding> selectAllBindings();
}
